/** FASSIT (Forms of Selective Attention in Intelligent Transportation Systems)
 * Computational Creativity and Digital Media
 * Cognitive and Media Systems Group
 * Centre for Informatics and Systems of the University of Coimbra (CISUC)
 *
 * Copyright (c) 2010-2013 University of Coimbra, Portugal
 * All rights reserved.
 */
package androidLayer;

import java.util.HashMap;

import poi.Info.POI;
import poi.Info.POIwithSAMetrics;

/**
 * HashMap with all POIs for all the possible User goals
 * 
 * @author Hernani Costa
 * 
 * @version 0.1 date: 29/03/2013
 */
public class PointsOfInterestByGoal {
	HashMap<String, HashMap<Integer, POI>> selectiveAttentionValues;
	HashMap<String, HashMap<Integer, POIwithSAMetrics>> agentExpectations;
	HashMap<String, HashMap<Integer, POIwithSAMetrics>> userModel;
	HashMap<String, HashMap<Integer, POIwithSAMetrics>> masterKnowledge;

	/**
	 * ------------------------------------------------------------------------
	 * Constructor class
	 * ------------------------------------------------------------------------
	 */
	public PointsOfInterestByGoal() {
		selectiveAttentionValues = new HashMap<String, HashMap<Integer,POI>>();
		agentExpectations = new HashMap<String, HashMap<Integer, POIwithSAMetrics>>();
		userModel = new HashMap<String, HashMap<Integer, POIwithSAMetrics>>();
		masterKnowledge = new HashMap<String, HashMap<Integer, POIwithSAMetrics>>();
	}

	/**
	 * ------------------------------------------------------------------------
	 * Returns a list of POIs for a specific goal
	 * ------------------------------------------------------------------------
	 * 
	 * @param goal
	 *            - user goal
	 * @return list of POIs for a specific goal
	 */
	public HashMap<Integer, POIwithSAMetrics> getAgentExpectationsByGoal(String goal) {
		return agentExpectations.get(goal);
	}

	public HashMap<Integer, POIwithSAMetrics> getUserModelByGoal(String goal) {
		return userModel.get(goal);
	}

	public HashMap<Integer, POIwithSAMetrics> getMasterAgentKnowledgeByGoal(String goal) {
		return masterKnowledge.get(goal);
	}

	public HashMap<Integer, POI> getSelectiveAttentionValuesByGoal(String goal) {
		return selectiveAttentionValues.get(goal);
	}



	/**
	 * Adds a list of POIs for a specific goal
	 * 
	 * @param goal
	 *            - user goal
	 * @param agentExpectations
	 *            - list of POIs for a specific goal
	 */
	public void addExpectationsAgent(String goal, HashMap<Integer, POIwithSAMetrics> agentExpectations) {
		this.agentExpectations.put(goal, agentExpectations);
	}

	public void addUserModel(String goal, HashMap<Integer, POIwithSAMetrics> userModel) {
		this.userModel.put(goal, userModel);
	}

	public void addMasterAgentKnowledge(String goal, HashMap<Integer, POIwithSAMetrics> masterKnowledge) {
		this.masterKnowledge.put(goal, masterKnowledge);
	}
	public void addSelectiveAttentionValues(String goal, HashMap<Integer, POI> selectiveAttentionValues) {
		this.selectiveAttentionValues.put(goal, selectiveAttentionValues);
	}

	
	
	public HashMap<String, HashMap<Integer, POI>> getSelectiveAttentionValues() {
		return selectiveAttentionValues;
	}

	public HashMap<String, HashMap<Integer, POIwithSAMetrics>> getAgentExpectations() {
		return agentExpectations;
	}

	public HashMap<String, HashMap<Integer, POIwithSAMetrics>> getUserModel() {
		return userModel;
	}

	public HashMap<String, HashMap<Integer, POIwithSAMetrics>> getMasterKnowledge() {
		return masterKnowledge;
	}

	public String toString() {
		for (String goal : masterKnowledge.keySet()) {
			HashMap<Integer, POIwithSAMetrics> master = masterKnowledge.get(goal);
			System.out.println("goal: " + goal);
			for (int poiID : master.keySet()) {
				System.out.println("M. AGENT: " + master.get(poiID).to_String());
				System.out.println("   AGENT: " + agentExpectations.get(goal).get(poiID).to_String());
				System.out.println("U. MODEL: " + userModel.get(goal).get(poiID).to_String());
				System.out.println("U. MODEL: " + userModel.get(goal).get(poiID).to_String());
			}
		}
		return null;
	}

}
